//app.js
App({ 
  globalData: {   
    imgUrl: "/image", //图片链接地址,
    uploadsUrl: "https://www.zmg666.com/uploads/zmg",
    apiUrl: "https://www.zmg666.com/api/zmg", //api接口 
    // apiUrl: "http://192.168.1.188:7005/api/zmg", //api接口 
  },

  onLaunch: function (options) {
    // 判断是否由分享进入小程序
    if (options.scene == 1007 || options.scene == 1008) {
      this.globalData.share = true
    } else {
      this.globalData.share = false
    };

    wx.getSystemInfo({
      success: (res) => {
        this.globalData.height = res.statusBarHeight
      }
    })
  
    wx.setStorageSync('uploadUrl', this.globalData.uploadsUrl);

    //请求图片头
    wx.request({
      url: this.globalData.apiUrl + '/sys/comm/file/uploadUrl',
      success: (res) => {
        if (res.data.success) {
          wx.setStorageSync('uploadUrl', res.data.datas.uploadUrl);
        }
      }
    })


  }


})